package com.yeban.javase.day06.test02_clone.clone1;

/**
 * @Desc TODO
 * @Author yeban
 * @Date 2025/10/14
 */
public class Car implements Cloneable{
    private String brand;
    private double price;

    public Car() {
    }

    public Car(String brand, double price) {
        this.brand = brand;
        this.price = price;
    }

    @Override
    protected Car clone() throws CloneNotSupportedException {
        return (Car)super.clone();
    }

    /**
     * 获取
     * @return brand
     */
    public String getBrand() {
        return brand;
    }

    /**
     * 设置
     * @param brand
     */
    public void setBrand(String brand) {
        this.brand = brand;
    }

    /**
     * 获取
     * @return price
     */
    public double getPrice() {
        return price;
    }

    /**
     * 设置
     * @param price
     */
    public void setPrice(double price) {
        this.price = price;
    }

//    public String toString() {
//        return "Car{brand = " + brand + ", price = " + price + "}";
//    }
}
